Component({
  data: {
    selectedIndex: 0,
  },
  attached() {},
  methods: {
    navigatorTabBar(e) {
      const data = e.currentTarget.dataset
      console.log(data)
      if (data.index * 1 === 1||data.index * 1 === 2) {
        wx.navigateTo({
          url: data.url
        });
      } else {
        this.setData({
          selectedIndex: data.index * 1
        });
        wx.switchTab({
          url: data.url
        });
      }
    },
  }
})